list="wmysql wmain wsocket"
for l in $list
do
  pid=`ps aux | grep ./build/${l} | awk '{print $2}'`
  pwd=`pwd | awk '{print $1}'`
  pname=${pwd}/build/${l}
  for e in $pid
  do
    exe=/proc/${e}/exe
    full=`readlink $exe`
    fname=${full% *}
    if [[ $fname = $pname ]]
    then
      echo "killing... " $pname
      kill $e
    fi
  done
done
